<div id='maintain-finish-input' class="container">
	<div class='weui-cells__title'>输入参数</div>
	<div class='weui-cells'>
		<div class='weui-cell'>
			<div class='weui-cell__hd'>
				<label class='weui-label'>车辆</label>
			</div>
			<div class='weui-cell__bd'>
				<vehicle_license_province class='vehicle-put'>渝</vehicle_license_province>
				<vehicle_license_number class='vehicle-put'>A YU456</vehicle_license_number>
				<small mute>#<customer_id class='vehicle-put reserve-apply'>123</customer_id></small>
			</div>
		</div>
		<div class='weui-cell'>
			<div class='weui-cell__hd'>
				<label class='weui-label'>服务站</label>
			</div>
			<div class='weui-cell__bd'>
				<ci_name class='station-put'>重庆XXXX</ci_name>
				<small mute>#<ci_code class='reserve-apply station-put'>代号</ci_code></small>
			</div>
		</div>
		<div class='weui-cell weui-cell_select'>
			<div class='weui-cell__hd'>
				<label class='weui-label'>服务类型</label>
			</div>
			<div class='weui-cell__bd'>
				<select class='weui-select reserve-apply' name='type'>
					<option value="">选择服务类型</option>
					<option value="1">强保</option>
					<option value="2">定保</option>
					<option value="3">维修</option>
				</select>
			</div>
		</div>
		<div class='weui-cell'>
			<div class='weui-cell__hd'>
				<label class='weui-label'>预约时间</label>
			</div>
			<label>
			<div class='weui-cell__bd'>
				<input name='apply_time' class='weui-input reserve-apply' placeholder="" type='date'/>
			</div>
			</label>
		</div>
		<label href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">
			<div class="weui-cell__hd">
				<input type="checkbox" class="weui-check reserve-apply" name="out">
				<i class="weui-icon weui-icon-checked"></i>
			</div>
			<div class="weui-media-box__bd">
				需要外出
			</div>
		</label>
	</div>
	<div class='weui-btn-area'>
		<a class='weui-btn weui-btn_primary' id='maintain-finish'>提交预约</a>
	</div>
</div>
<div id='maintain-finish-success' class="weui-msg hidden" style="margin: 50px 0 0 0;">
	<div class="weui-msg__icon-area"><i class="weui-icon weui-icon-success weui-icon_msg"></i></div>
	<div class="weui-msg__text-area">
		<h2 class="weui-msg__title">预约成功</h2>
		<!-- <p class="weui-msg__desc">内容详情，可根据实际需要安排，如果换行则不超过规定长度，居中展现<a href="javascript:void(0);">文字链接</a></p> -->
	</div>
	<div class="weui-msg__opr-area">
		<p class="weui-btn-area">
			<a id='vehicle-add-more' href="#maintain" class="weui-btn weui-btn_default">返回</a>
		</p>
	</div>
</div>
<script>
	$(function(){
		var l = $('#maintain-user-vehicle-list input:checked').parents('.bc-list-line');
		$('.vehicle-put').each(function(index, el) {
			$(el).html(l.find(el.tagName).eq(0).html());
		});
		var s = $('.station-selected')
		$('.station-put').each(function(index, el) {
			$(el).html(s.find(el.tagName).eq(0).html());
		});
		POST.init('#maintain-finish',{
			text:"提交",
			url:'/maintain/reserve_create',
			input:function(){
				var r = {};
				$('.reserve-apply').each(function(index, el) {
					var key = $(el).attr('name') || el.tagName.toLowerCase();
					if(key == 'out'){
						var content = $(el).prop('checked')*1;
					}else if(key == 'type'){
						var content = $(el).val();
					}else{
						var content = $(el).val() || $(el).html();
					}
					if(key){
						r[key] = content;
					}
				});
				return r;
			},
			success:function(){
				$('#maintain-finish-success').removeClass('hidden');
				$('#maintain-finish-input').addClass('hidden');
			}
		})
	})
</script>